package com.jyy.prefabricated.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyy.prefabricated.enums.BaseTeamEnum;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 证书
 */
@Data
public class Certificate implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    /**
     * 证书种类
     */
    @NotNull(message = "证书种类不能为空")
    private Integer categoryId;

    /**
     * 证书类型
     */
    @NotNull(message = "证书类型不能为空")
    private Integer type;

    /**
     * 证书名称
     */
    @NotNull(message = "证书名称不能为空")
    private String name;

    /**
     * 证书编号
     */
    @NotNull(message = "证书编号不能为空")
    private String code;

    /**
     * 编号规则
     */
    @NotNull(message = "编号规则不能为空")
    private String codeRule;

    /**
     * 是否永久
     */
    private Boolean perpetuity = false;
    private Boolean showAchievement;
    /**
     * 有效期
     */
    private String termOfValidity;

    /**
     * 证书单位
     */
    @NotNull(message = "证书单位不能为空")
    private String certificateCompany;

    /**
     * 证件示例图
     */
    @NotNull(message = "证件示例图不能为空")
    private String image;

    private String background;

    private String qrCode;

    /**
     * 是否逻辑删除
     */
    private Boolean deleted = false;

    /**
     * 租户编码
     */
    private String teamCode = BaseTeamEnum.BASE.getValue();

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

}